Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

New features for 1.0.0-beta #52

Merged
merged 7 commits into from
Jan 5, 2017

Conversation

matanlurey
Copy link
Contributor

I don't expect anyone to get to this before the new year

Closes dart-lang/tools#894
Closes dart-lang/tools#970
Closes dart-lang/tools#968

Partial support on dart-lang/tools#966

1.0.0-beta

  • Add support for async, sync, sync* functions
  • Add support for expression asAwait, asYield, asYieldStar
  • Add toExportBuilder and toImportBuilder to types and references
  • Fix an import scoping bug in return statements and named constructor invocations.
  • Added constructor initializer support
  • Add while and do {} while loop support
  • Add for and for-in support
  • Added a name getter for ParameterBuilder

/cc @alorenzen

Copy link
Contributor

@natebosch natebosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests for increment and decrement?

@@ -210,8 +240,13 @@ abstract class AbstractExpressionMixin implements ExpressionBuilder {
}

@override
ExpressionBuilder increment([bool prefix = false]) {
return new _IncrementExpression(this, prefix);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] how are you choosing between => and return? Why is this one different from decrement above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying not to use => when it creates a new line, but probably inconsistent.

ExpressionBuilder identical(ExpressionBuilder other) {
return lib$core.identical.call([
return lib$core.identical.call(<ExpressionBuilder>[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this fixing an analyzer warning? I'd be surprised if this wasn't inferred in strong mode...

Copy link
Contributor Author

@matanlurey matanlurey Jan 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it could not infer the type and warned as such.

@@ -186,7 +186,18 @@ abstract class ConstructorBuilder
HasStatements,
ValidClassMember {
/// Create a new [ConstructorBuilder], optionally with a [name].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc comment is no longer complete. This is a case where we can add useful information explaining the 'super' arguments ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged.

List<ExpressionBuilder> invokeSuper,
}) = _NormalConstructorBuilder;

/// Adds a constructor initializer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] 'constructor initializer' reads a bit strange to me... how about

/// Adds a field initializer to this constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -47,6 +47,9 @@ final Token $deferred = new KeywordToken(Keyword.DEFERRED, 0);
/// The `/` token.
final Token $divide = new Token(TokenType.SLASH, 0);

/// The `do` keyword.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we consider dropping this lint? The zero-information comments are very noisy throughout

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make it consistent I'll drop them all in another PR.

@@ -95,4 +95,48 @@ void main() {
);
});
});

group('for statemnets', () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] typo in statements

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@natebosch natebosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a test for increment/decrement in a followup

@matanlurey matanlurey merged commit b2d01d4 into dart-archive:master Jan 5, 2017
@matanlurey matanlurey deleted the new-features branch January 5, 2017 01:23
mosuem pushed a commit to dart-lang/tools that referenced this pull request Oct 25, 2024
* Add for/for-in loop

Closes https://github.com/dart-lang/code_builder/issues/49

* Add support for while/do-while

* Add constructor initializers

Closes https://github.com/dart-lang/code_builder/issues/50

* Update CHANGELOG and pubspec for beta

* Add “name” getter for ParameterBuilder

Partial support towards https://github.com/dart-lang/code_builder/issues/43

* Update CHANGELOG

* Address feedback
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support while/do while loops Support for-loops (including await for) Create constructor initializer list
3 participants